namespace QueryBuilder.Core.Query
{
    /// <summary>
    /// 
    /// </summary>
    public class AliasedConstraint : Constraint
    {
        /// <summary>
        /// Initializes a new instance of the <see cref="AliasedConstraint"/> class.
        /// </summary>
        /// <param name="alias">The alias.</param>
        /// <param name="constraint">The constraint.</param>
        public AliasedConstraint(string alias, Constraint constraint)
        {
            this.Alias = alias;
            this.Constraint = constraint;
        }

        /// <summary>
        /// Gets or sets the alias.
        /// </summary>
        /// <value>The alias.</value>
        public string Alias { get; set; }

        /// <summary>
        /// Gets or sets the constraint.
        /// </summary>
        /// <value>The constraint.</value>
        public Constraint Constraint { get; set; }

        /// <summary>
        /// Accepts the specified constraint presenter.
        /// </summary>
        /// <param name="constraintPresenter">The constraint presenter.</param>
        public override void Accept(IConstraintPresenter constraintPresenter)
        {
            constraintPresenter.Present(this);
        }
    }
}